package com.demo2do.fms.admin.service.supplier;

import java.util.List;
import java.util.Map;

import com.demo2do.core.entity.page.Page;
import com.demo2do.fms.admin.entity.export.supplier.VehicleSourceSheet;
import com.demo2do.fms.admin.entity.report.supplier.VehicleSourceReportSearch;
import com.demo2do.fms.admin.entity.search.supplier.VehicleSourceSearch;
import com.demo2do.fms.admin.entity.security.Login;
import com.demo2do.fms.admin.service.DataService;
import com.demo2do.fms.entity.vehicle.source.SyncStatus;
import com.demo2do.fms.entity.vehicle.source.VehicleGpsInfo;
import com.demo2do.fms.entity.vehicle.source.VehicleSource;
import com.demo2do.fms.entity.vehicle.tractor.Tractor;

/**
 *
 * @author Ark
 *
 */
public interface VehicleSourceService extends DataService<VehicleSource> {

    /**
     * @param login
     * @param status
     * @return
     */
    public int count(Login login, SyncStatus status);
    
    /**
     * @param login
     * @param status
     * @param page
     * @return
     */
    public List<VehicleSource> list(Login login, SyncStatus status, Page page);
    
    /**
     * 
     * @param search
     * @return
     */
    public int count(VehicleSourceSearch search);
    
    /**
     * @param search
     * @param page
     * @return
     */
    public List<VehicleSource> search(VehicleSourceSearch search, Page page);
    
    /**
     * 车辆绑定
     * 
     * @param info
     * @param login
     */
    public void bind(Tractor tractor, Long trailerId, Login login);
    
    /**
     * 
     * @param vehicleSource
     * @param operator
     */
    public void unbind(VehicleSource vehicleSource, Long operator);
    
    /**
     * @param trailerId
     */
    public VehicleSource loadVehicleSource(Long trailerId);
    
    /**
     * @param vehicleSource
     * @param trailerId
     * @param operator
     */
    public void changeTrailer(VehicleSource vehicleSource, Long trailerId, Long operator);
    
    /**
     * @param vehicleSource
     * @param operator
     */
    public void declare(VehicleSource vehicleSource, Long operator);
    
    /**
     * @param vehicleSource
     * @param operator
     */
    public void cancelDeclare(VehicleSource vehicleSource, Long operator);
    
    /**
     * @return
     */
    public int countDeclare();
    
    /**
     * @param page
     * @return
     */
    public List<VehicleSource> listDeclare(Page page);
    
    /**
     * @param vehicleId
     * @param operator
     */
    public void sign(Long vehicleId, Long operator);
    
    /**
     * @param vehicleIds
     * @param operator
     * @return
     */
    public int batchSign(List<Long> vehicleIds, Long operator);
    
    /**
     * @param vehicleSource
     * @param operator
     */
    public void reject(VehicleSource vehicleSource, Long operator);
    
    /**
     * @param vehicleSource
     * @param operator
     */
    public void out(VehicleSource vehicleSource, Long operator);
    
    /**
     * 
     * @param login
     * @return
     */
    public int countQualified(Login login);
    
    /**
     * @param login
     * @param page
     * @return
     */
    public List<VehicleSource> listQualified(Login login, Page page);
    
    /**
     * 分属供方车辆列表
     * 
     * @param login
     * @return
     */
    public int countSub(Login login);
    
    /**
     * 分属供方车辆列表
     * 
     * @param login
     * @param page
     * @return
     */
    public List<VehicleSource> listSub(Login login, Page page);
    
    /**
     * @param search
     * @param login
     * @return
     */
    public int countSub(VehicleSourceSearch search, Login login);
    
    /**
     * @param search
     * @param login
     * @param page
     * @return
     */
    public List<VehicleSource> searchSub(VehicleSourceSearch search, Login login, Page page);
    
    /**
     * @param id
     * @return
     */
    public VehicleGpsInfo loadVehicleGpsInfo(Long id);
    
    /**
     * 
     * @param vehicleIds
     * @return
     */
    public List<VehicleSourceSheet> generateExport(List<Long> vehicleIds);
    
    /**
     * 
     * @param search
     * @return
     */
    public List<Map<String, Object>> export(VehicleSourceReportSearch search);
    
}
